﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Centny.PdfReader.IO;
namespace Centny.PdfReader.Types
{
    public class PdfDictionary : PdfClass
    {
        public Dictionary<PdfName, PdfClass> Data { get; set; }
        public PdfDictionary()
        {
            this.Data = new Dictionary<PdfName, PdfClass>();
        }
        public PdfClass this[String n]
        {
            get
            {
                PdfName pn = new PdfName(n);
                if (this.Data.ContainsKey(pn))
                {
                    return this[pn];
                }
                else
                {
                    return null;
                }
            }
            set
            {
                this[new PdfName(n)] = value;
            }
        }
        public PdfClass this[PdfName n]
        {
            get
            {
                if (this.Data.ContainsKey(n))
                {
                    return this.Data[n];
                }
                else
                {
                    return null;
                }
            }
            set
            {
                this.Data[n] = value;
            }
        }
    }
}
